
function pathUtils() {
    this.getQueryString = (paramName) => {
        const url = location.search
        const param = {}
        if (url.indexOf('?') != -1) {
            const str = url.substr(1)
            const strArr = str.split('&')
            for (let i = 0; i < strArr.length; i++) {
                param[strArr[i].split('=')[0]] = decodeURI(strArr[i].split('=')[1]) // 可解析中文
            }
        }
        if (typeof paramName === 'string') {
            return param[paramName]
        }
        return param
    }
}

export const $pathUtils = new pathUtils()
